import str from './char'


 const getToken = () => {
	let auth = sessionStorage.getItem('authInfo');
	let token;
	if(auth) {
		auth = JSON.parse(auth);
		let type = auth.token_type;
		let access_token = auth.access_token;
		if(type && access_token) {
			token = str.caseUpfirstChar(type) + " " + access_token;
		}
	}
	return token;
}

 const isAuth = () => {
	if(getToken()) {
		return true;
	} else {
		return false;
	}
}
export default{
	getToken,isAuth
}
